/**
 * Copyright 2009 Adam Ruggles.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.code.sapien.dao;

import java.util.List;

import com.google.code.sapien.dao.jpa.ResponseJpaDAO;
import com.google.code.sapien.model.Discussion;
import com.google.code.sapien.model.Response;
import com.google.inject.ImplementedBy;

/**
 * Interface for Response Data Access Objects.
 * @author Adam
 * @version $Id: ResponseDAO.java 23 2009-05-12 04:28:58Z a.ruggles $
 * 
 * Created on Feb 9, 2009 at 10:17:09 PM 
 */
@ImplementedBy(ResponseJpaDAO.class)
public interface ResponseDAO extends EntityDAO<Response> {

	/**
	 * Returns the total number of responses for a given discussion.
	 * @param discussion The discussion.
	 * @return The total number of responses for a given discussion.
	 */
	int getCount(final Discussion discussion);

	/**
	 * Returns a subset of responses for a given discussion.
	 * @param discussion The discussion.
	 * @param orderBy The field to order the results by.
	 * @param asc A flag to order the "OrderBy" clause either ascending (true) or descending (false).
	 * @param offset The offset in the results set for the first response to return.
	 * @param maxResults The maximum number of results to return.
	 * @return A subset of responses for a given discussion.
	 */
	List<Response> list(Discussion discussion, String orderBy, boolean asc, int offset, int maxResults);
}
